package com.up.upzl.biz.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.up.upzl.biz.service.SequenceService;

@Service
public class SequenceServiceImpl implements SequenceService {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public Long currVal(String sequnce) {
		return jdbcTemplate.queryForObject("SELECT currval( ? )", Long.class, sequnce);
	}

	@Override
	public Long nextVal(String sequnce) {
		return jdbcTemplate.queryForObject("SELECT nextval( ? )", Long.class, sequnce);
	}

}
